package com.depthsdata.coe.api;

import com.depthsdata.coe.dao.BusinessNodeDAOQueryBean;
import com.depthsdata.coe.dao.BusinessProcessDiagramDAOQueryBean;
import com.depthsdata.coe.service.BusinessNodeBean;
import com.ourteam.frame.web.AbstractSearchModel;

public class BusinessNodeSearchBean extends AbstractSearchModel<BusinessNodeDAOQueryBean> {

	private Long businessProcessId;

	public Long getBusinessProcessId() {
		return businessProcessId;
	}

	public void setBusinessProcessId(Long businessProcessId) {
		this.businessProcessId = businessProcessId;
	}

	@Override
	public String getMappedDAOField(String aProperty) {
		return BusinessNodeBean.getMappedDAOField(aProperty);
	}

	@Override
	protected void doBuildQueryBean(BusinessNodeDAOQueryBean queryBean) throws Exception {

		BusinessNodeDAOQueryBean.Criteria criteria = queryBean.createCriteria();

		if (businessProcessId != null && businessProcessId.longValue() != 0) {
			criteria.andBusinessProcessIdEqualTo(businessProcessId);
		}

	}

}
